Welcome Guest | Sign in | Register

Home > C Programming > Defining Variables > Questions and Answers

01. The correct define statement for a constant called TRUE, which has a value of 1 is
A. int TRUE = 1; B. #define TRUE = 1
C. #define TRUE 1; D. #define TRUE 1

Answer and Explanation

Answer: #define TRUE 1

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
02. The correct definition for a variable called money which can be used to hold currency, is
A. money : real; B. real money;
C. float money; D. money float;

Answer and Explanation

Answer: float money;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
03. The correct definition of a variable called arctan which will hold scientific notation values (+e), is
A. arctan : float; B. real arctan;
C. double arctan; D. arctan float;

Answer and Explanation

Answer: double arctan;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
04. The correct definition of an integer variable called total initialized to zero, is
A. total : integer = 0; B. total = 0, int;
C. int total = 0; D. int = 0, total;

Answer and Explanation

Answer: int total = 0;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
05. The correct definition of a variable called loop, which can hold an integer value, is
A. loop : integer; B. integer loop;
C. int loop; D. loop int;

Answer and Explanation

Answer: int loop;

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
06. The correct define statement for a constant called GST with a value of .125, is
A. #define GST 0.125 B. GST .125;
C. float GST=0.125; D. #define GST .125;

Answer and Explanation

Answer: #define GST 0.125

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
07. What will be output of the following c program?
#include "stdio.h"
int main()
{
int _ = 5;
int __ = 10;
int ___;
___ = _ + __;
printf("%i", ___);
return 0;
}
A. 5 B. 10
C. 15 D. Compilation Error

Answer and Explanation

Answer: 15

Explanation:
Variable name can have only underscore

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
08. What will be output of the following c program?
#include
int main(){
int max-val=100;
int min-val=10;
int avg-val;
avg-val = max-val + min-val / 2;
printf("%d",avg-val);
return 0;
}  
A. 55 B. 105
C. 60 D. Compilation error
E. None of these

Answer and Explanation

Answer: Compilation error

Explanation:
We cannot use special character – in the variable name.  

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
09. Which of the following special symbol allowed in a variable name?
A. (asterisk) B. | (pipeline)
C. hyphen D. _ (underscore)

Answer and Explanation

Answer: _ (underscore)

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
10. Is there any difference between following declarations?
1 : extern int fun();
2 : int fun();
A. Both are identical B. No difference, except extern int fun(); is probably in another file
C. int fun(); is overrided with extern int fun(); D. None of these

Answer and Explanation

Answer: No difference, except extern int fun(); is probably in another file

Explanation:
No difference, except extern int fun(); is probably in another file

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum



Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.